package cn.wx.scholar.core.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import cn.wx.common.persistence.base.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import cn.wx.scholar.core.service.ScholarCindexService;
import cn.wx.scholar.core.entity.ScholarCindex;
import cn.wx.common.persistence.web.ResponseData;
import cn.wx.scholar.core.entity.qo.ScholarCindexQ;
/**
 *   @description : ScholarCindex 控制器
 *   ---------------------------------
 *   @author  
 *   @since 2018-11-26
 */
@RestController
@RequestMapping("/scholarCindex")
public class ScholarCindexController extends BaseController {

    @Autowired
    private ScholarCindexService scholarCindexService;

    /**
     * @description : 通过条件获取ScholarCindex
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-26
     */
    @RequestMapping(value = "/query/unique", method = RequestMethod.POST)
    public ResponseData queryUnique(ScholarCindexQ scholarCindexQ) throws Exception {
        return success(scholarCindexService.queryUnique(scholarCindexQ,ScholarCindex.class));
    }

    /**
     * @description : 通过条件获取ScholarCindex分页
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-26
     */
    @RequestMapping(value = "/query/page", method = RequestMethod.POST)
    public ResponseData queryPage(ScholarCindexQ scholarCindexQ) throws Exception {
        return success(scholarCindexService.queryPage(scholarCindexQ));
    }

	/**
     * @description : 通过条件获取ScholarCindex
     * ---------------------------------
     * @author : 
     * @since : Create in 2018-11-26
     */
    @RequestMapping(value = "/query/list", method = RequestMethod.POST)
    public ResponseData queryList(ScholarCindexQ scholarCindexQ) throws Exception {
        return success(scholarCindexService.queryList(scholarCindexQ));
    }

    /**
     * @description : 通过id更新ScholarCindex
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-26
     */
    @RequestMapping(value = "/modify", method = RequestMethod.POST)
    public ResponseData modify(ScholarCindex scholarCindex) throws Exception {
        return success(scholarCindexService.modify(scholarCindex));
    }
    
    /**
     * @description : 新增ScholarCindex
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-26
     */
     @RequestMapping(value = "/create", method = RequestMethod.POST)
     public ResponseData create(ScholarCindex scholarCindex) throws Exception {
        return success(scholarCindexService.create(scholarCindex));
     }
}